<template>
  <div>
    <el-table class="mt10" v-loading="loading" :data="dealList"
              @selection-change="handleSelectionChange" border stripe
    >
      <el-table-column type="selection" :selectable="checkSelectable" width="55" align="center"/>
      <el-table-column label="处置编号" prop="taskNo" align="center" width="150">
        <template slot-scope="scope">
          {{ scope.row.taskNo }}
        </template>
      </el-table-column>
      <el-table-column label="物品编号" prop="proNo" align="center" width="240"/>
      <el-table-column label="物品名称" prop="proName" align="center" min-width="200"/>
      <el-table-column label="申请单位" prop="handleUnitName" align="center" min-width="260">
        <template slot-scope="scope">
          {{ scope.row.applyUnit }}
        </template>
      </el-table-column>
      <el-table-column label="处置数量" prop="applyNumber" align="center" min-width="100"/>
      <el-table-column label="处置意见" align="center" prop="dealType" width="150">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.deal_type" :value="scope.row.disposalType"/>
        </template>
      </el-table-column>
      <el-table-column label="申请时间" prop="applyTime" align="center" min-width="260"/>
      <el-table-column label="在管理中心" align="center" width="100">
        <template slot-scope="scope">
          {{ scope.row.inCenter ? '是' : '否' }}
        </template>
      </el-table-column>
      <el-table-column label="需要评估" align="center" width="100">
        <template slot-scope="scope">
          {{ scope.row.needEvaluate ? '是' : '否' }}
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page-sizes="[10,50,100,200,500]"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { listDisposalNotRegister } from '@/api/oms/dealTask'

export default {
  dicts: ['deal_type'],
  props: {
    queryParams: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      total: 0,
      loading: false,
      selectList: [],
      dealList: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.loading = true
      listDisposalNotRegister(this.queryParams).then(response => {
        this.dealList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    checkSelectable(row) {
      return !row.needEvaluate
    },
    handleSelectionChange(selection) {
      this.selectList = selection
    }
  }
}
</script>

<style scoped>

</style>
